メインコンテンツへスキップ

All Posts

News bits

Gemini APIがファイルサイズ制限緩和と入力サポート拡大を発表

GoogleはGemini APIのアップデートを発表し、データ入力方法の拡充とファイルサイズ制限の緩和を行った。これにより、開発者は既存のデータを移動させることなく、より簡単にAIアプリケーションに統合できるようになった。

主な変更点:

  • 外部URL(公開/署名付き)のサポート: 公開URLや署名付きURL(AWS S3、Azure Blob Storageなど)を直接リクエストに含めることが可能になり、中間サーバーへのダウンロードが不要になった。
  • Google Cloud Storage (GCS) オブジェクトの登録: GCS内のファイルを移動せずに直接Files APIに登録できるようになった。
  • インラインファイルサイズ制限の緩和: インラインデータの最大ペイロードサイズが20MBから100MBに増加し、プロトタイピングやリアルタイム処理が容易になった。

これらの機能は最新のGenAI SDKで利用可能。

出展:Increased file size limits and expanded inputs support in Gemini API

Gemini APIのURLコンテキストツールが一般公開、PDFや画像のサポートを追加

Gemini APIのURLコンテキストツールが一般公開された。このツールにより、開発者はコンテンツを手動でアップロードする代わりに、URL形式でモデルに追加のコンテキストを提供できるようになる。

またURLコンテキストツールがWebページや構造化データ、テキストファイルに加えて、PDFや画像にも対応した。

URLコンテキストツールは、Gemini CLIのweb_fetchコマンドでも利用されている。

Gemini APIで利用する場合は次のようにtoolsを設定する。

python
from google import genai
from google.genai.types import Tool, GenerateContentConfig
client = genai.Client()

model_id = "gemini-2.5-flash"
tools = [
     {"url_context": {}},
 ]


response = client.models.generate_content(
    model=model_id,
    contents="What are the top 3 recent announcements from the Gemini API according to https://ai.google.dev/gemini-api/docs/changelog",
    config=GenerateContentConfig(
        tools=tools,
    )
)

出展:URL context tool for Gemini API now generally available

Gemini API Batch Mode、50%割引で大量処理に対応

Google が Gemini API に Batch Mode を導入した。高スループット、レイテンシーが重要でないワークロード向けの新しい非同期エンドポイントで、同期 API と比較して 50%割引で提供される。

24 時間以内に結果を取得可能で、より高いレート制限を提供。複雑なクライアントサイドキューイングや再試行ロジックが不要。全リクエストを単一ファイルにパッケージ化し、ジョブを送信、完了後に結果を取得する簡単なワークフロー。

対応モデルは Gemini 2.5 Flash と Gemini 2.5 Pro。Google GenAI Python SDK で利用可能。

python
uploaded_batch_requests = client.files.upload(file="batch_requests.json")
batch_job = client.batches.create(
    model="gemini-2.5-flash",
    src=uploaded_batch_requests.name,
    config={'display_name': "batch_job-1"}
)

出展:Batch Mode in the Gemini API: Process more for less

著者について

Hi there. I'm hrdtbs, a frontend expert and technical consultant. I started my career in the creative industry over 13 years ago, learning on the job as a 3DCG modeler and game engineer in the indie scene.

In 2015 I began working as a freelance web designer and engineer. I handled everything from design and development to operation and advertising, delivering comprehensive solutions for various clients.

In 2016 I joined Wemotion as CTO, where I built the engineering team from the ground up and led the development of core web and mobile applications for three years.

In 2019 I joined matsuri technologies as a Frontend Expert, and in 2020 I also began serving as a technical manager supporting streamers and content creators.

I'm so grateful to be working in this field, doing something that brings me so much joy. Thanks for stopping by.